<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<HTML>
<!-- HTML file produced from file: manual.tex --
 -- using Hyperlatex v 2.3.1 (c) Otfried Cheong--
 -- on Emacs 21.4 (patch 15) "Security Through Obscurity" XEmacs Lucid, Fri Dec  3 20:36:14 2004 -->
<HEAD>
<TITLE>Scheme 48 Manual -- Inspection mode</TITLE>

</HEAD><BODY BGCOLOR="#ffffff">
<EM>Scheme 48 Manual</EM> | <A HREF="s48manual.html#top_node">Contents</A> | In Chapter: <A HREF="s48manual_11.html">Command processor</A><BR>Previous: <A HREF="s48manual_17.html">Switches</A> | Next: <A HREF="s48manual_19.html">Command programs</A>
<H2>Inspection mode</H2>

<P>There is a data inspector available via the <CODE>,inspect</CODE> and
 <CODE>,debug</CODE> commands or by setting the <CODE>inspect-focus-value</CODE> switch.
The inspector is particularly useful with procedures, continuations,
 and records.
The command processor can be taken out of inspection mode by
 using the <CODE>q</CODE> command, by unsetting the <CODE>inspect-focus-value</CODE> switch,
 or by going to a command level where the <CODE>inspect-focus-value</CODE> is not
 set.
When in inspection mode, input that begins with
  a letter or digit is read as a command, not as an expression.
To see the value of a variable or number, do <CODE>(begin <CODE><I>exp</I></CODE>)</CODE>
  or use the <CODE>,run <CODE><I>exp</I></CODE></CODE> command.
<P>In inspection mode the command processor prints out a
 menu of selectable components for the current focus object.
To inspect a particular component, just type the corresponding number in
 the menu.
That component becomes the new focus object.
For example:
<BLOCKQUOTE><PRE>
&gt; ,inspect '(a (b c) d)
(a (b c) d)

[0] a
[1] (b c)
[2] d
: 1
(b c)

[0] b
[1] c
: 
</PRE></BLOCKQUOTE>
<P>When a new focus object is selected the previous one is pushed onto a
 stack.
You can pop the stack, reverting to the previous object, with
 the <CODE>u</CODE> command, or use the <CODE>stack</CODE> command to move to
 an earlier object.
<P>Commands useful when in inspection mode:
<UL><LI><CODE>u</CODE> (up) pop object stack
<LI><CODE>m</CODE> (more) print more of a long menu
<LI><CODE>(...)</CODE> evaluate a form and select result
<LI><CODE>q</CODE> quit
<LI><CODE>template</CODE> select a closure or continuation's template
 (Templates are the static components of procedures; these are found
  inside of procedures and continuations, and contain the quoted
  constants and top-level variables referred to by byte-compiled code.)
<LI><CODE>d</CODE> (down) move to the next continuation
 (current object must be a continuation)
<LI><CODE>menu</CODE> print the selection menu for the focus object
</UL>
<P>Multiple selection commands (<CODE>u</CODE>, <CODE>d</CODE>, and menu indexes)
 may be put on a single line.
<P>All ordinary commands are available when in inspection mode.
Similarly, the inspection commands can be used when not in inspection
 mode.
For example:
<BLOCKQUOTE><PRE>
&gt; (list 'a '(b c) 'd)
'(a (b c) d)
&gt; ,1
'(b c)
&gt; ,menu
[0] b
[1] c
&gt; 
</PRE></BLOCKQUOTE>
<P>If the current command level was initiated because of
 a breakpoint in the next level down, then 
 <CODE>,debug</CODE> will invoke the inspector on the
 continuation at the point of the error.
The <CODE>u</CODE> and <CODE>d</CODE> (up and down)
commands then make the inspected-value stack look like a conventional stack
debugger, with continuations playing the role of stack frames.  <CODE>D</CODE> goes
to older or deeper continuations (frames), and <CODE>u</CODE> goes back up to more
recent ones.
<P><P>
  
Previous: <A HREF="s48manual_17.html">Switches</A> | Next: <A HREF="s48manual_19.html">Command programs</A></BODY></HTML>
